import router from '../router'
export function PagesJump(urls, Markdowns, Picturelist, cards, sort) {
	if (Picturelist) {
		router.push({
			name: urls,
			query: {Picturelist: Picturelist, t: Date.now()}
		})
	} else if (Markdowns) {
		router.push({
			name: urls,
			query: {Markdowns: Markdowns, t: Date.now()}
		})
	} else if (sort) {
		router.push({
			name: urls,
			query: {sort: sort, t: Date.now()}
		})
	} else {
		router.push({
			name: urls,
			query: {t: Date.now(), cards: cards}
		})
	}
}
export function formatDate(date, format) {
	let yFull = date.getFullYear()
	let y = date.getYear()
	let m = date.getMonth() + 1
	let d = date.getDate()
	let time = ''
	if (format == 'YY/MM/DD') {
		time = y + '/' + m + '/' + d
	} else if (format == 'YYYY/MM/DD') {
		time = yFull + '/' + m + '/' + d
	} else if (format == 'YY-MM-DD') {
		time = y + '-' + m + '-' + d
	} else if (format == 'YYYY-MM-DD') {
		time = yFull + '-' + m + '-' + d
	} else {
		time = yFull + '-' + m + '-' + d
	}
	return time
}
